package com.sskj.mine.asset;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.bean.PageBean;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.mine.asset.data.CoinTypeBean;
import com.sskj.mine.asset.data.RecordsBean;
import com.sskj.mine.http.HttpConfig;
import com.sskj.mine.presenter.BasePresenter;
import com.sskj.mine.asset.AssetRecordsActivity;

import java.util.List;


/**
 * @author Hey
 * Create at  2019/05/04
 */
class AssetRecordsPresenter extends BasePresenter<AssetRecordsActivity> {


    /**
     * 币种类型 (筛选用)
     *
     * @return
     */
    public void getAssetType(){
        httpService.getAssetType().execute(new JsonCallBack<HttpData<List<CoinTypeBean>>>() {
            @Override
            public void onSuccess(Response<HttpData<List<CoinTypeBean>>> response) {
                HttpData<List<CoinTypeBean>> httpData = response.body();
                if (httpData.getStatus() == HttpConfig.OK) {

                    mView.updateType(httpData.getData());
                }
            }
        });
    }

    /**
     * 充值/提币记录
     *
     * @param type recharge 充值 cash 提币
     * @param pid 币种id
     * @return
     */
    public void getAssetRecord(String type,String pid){
          httpService.getAssetRecord( type, pid).execute(new JsonCallBack<HttpData<PageBean<RecordsBean>>>() {
            @Override
            public void onSuccess(Response<HttpData<PageBean<RecordsBean>>> response) {
                HttpData<PageBean<RecordsBean>> httpData = response.body();
                if (httpData.getStatus() == HttpConfig.OK) {
                
                }
            }
        });
    }
}
